padded_en_sents = []
padded_cn_sents = []
padded_cn_label_sents = []
for en, cn in filtered_pairs:
    # reverse source sentence
    padded_en_sent = en + ['<eos>'] + ['<pad>'] * (MAX_LEN - len(en))
    padded_en_sent.reverse() 
    # (list:11) 
    # ['<pad>', '<pad>', '<pad>','<pad>', '<pad>', '<pad>',     '<pad>', '<pad>', '<eos>', 'try', 'i'] 

    padded_cn_sent=['<bos>'] + cn+['<eos>']+ ['<pad>']*(MAX_LEN - len(cn))
    padded_cn_label_sent = cn + ['<eos>'] + ['<pad>']*(MAX_LEN - len(cn)+1)

    #  (list:12) 
    # ['我','试','试','。','<eos>','<pad>','<pad>','<pad>', 
    #                        '<pad>','<pad>','<pad>','<pad>']
    padded_en_sents.append([en_vocab[w] for w in padded_en_sent])
    padded_cn_sents.append([cn_vocab[w] for w in padded_cn_sent])
    padded_cn_label_sents.append([cn_vocab[w] for w in padded_cn_label_sent])
train_en_sents = np.array(padded_en_sents)
train_cn_sents = np.array(padded_cn_sents)
train_cn_label_sents = np.array(padded_cn_label_sents)

print(train_en_sents.shape) # (6810, 11)
print(train_cn_sents.shape) # (6810, 12)
print(train_cn_label_sents.shape)# (6810, 12) 
